﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace Gds.Model.TestFunctionModel
{
    public  class TaskRunStateModel:INotifyPropertyChanged
    {
        private bool _isRun;
        private int _taskIndex;
        private string _currentStep;
        private string _currentReadPotencyStep;
        private string _startTime;
        private string _endTime;
        private int _emptyRespondTime;
        private int _needMoreRespondTime;

        /// <summary>
        /// 是否在运行
        /// </summary>
        public bool IsRun
        {
            get { return _isRun; }
            set { _isRun = value; OnPropertyChange(); }
        }
        /// <summary>
        /// 任务号 总线号
        /// </summary>
        public int TaskIndex
        {
            get { return _taskIndex; }
            set { _taskIndex = value; OnPropertyChange(); }
        }
        /// <summary>
        /// 当前运行状态
        /// </summary>
        public string CurrentStep
        {
            get { return _currentStep; }
            set { _currentStep = value; OnPropertyChange(); }
        }
        /// <summary>
        /// 当前读取浓度状态
        /// </summary>
        public string CurrentReadPotencyStep
        {
            get { return _currentReadPotencyStep; }
            set { _currentReadPotencyStep = value; OnPropertyChange(); }
        }
        /// <summary>
        /// 开始时间
        /// </summary>
        public string StartTime
        {
            get { return _startTime; }
            set { _startTime = value; OnPropertyChange(); }
        }
        /// <summary>
        /// 结束时间
        /// </summary>
        public string EndTime
        {
            get { return _endTime; }
            set { _endTime = value; OnPropertyChange(); }
        }
        /// <summary>
        /// 回复为空次数
        /// </summary>
        public int EmptyRespondTime
        {
            get { return _emptyRespondTime; }
            set { _emptyRespondTime = value; OnPropertyChange(); }
        }
        /// <summary>
        /// 需要等待更多时间次数
        /// </summary>
        public int NeedMoreRespondTime
        {
            get { return _needMoreRespondTime; }
            set { _needMoreRespondTime = value; OnPropertyChange(); }
        }
        public void ReInit()
        { 
            
        }
        public event PropertyChangedEventHandler PropertyChanged;
        public virtual void OnPropertyChange([CallerMemberName] string propertyName = null)
        { 
            if(PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
